/*
 * matching.h
 *
 *  Created on: May 1, 2011
 *      Author: tqlong
 */

#ifndef MATCHER_H_
#define MATCHER_H_

#include <vector>
#include <queue>
#include "../tree/kdtree.h"
#include "../tree/tree_visitors.h"

/** It is possible to match two different dataset_type
 *  However, their vec_types should be the same
 */
template <typename D1,  typename D2>
struct Matcher
{
  typedef D1    dataset1_type;
  typedef D2    dataset2_type;
  typedef typename D1::vec_type    vec_type;
//  typedef typename D2::vec_type    vec_type;

  dataset1_type& m_data1;
  dataset2_type& m_data2;

  Matcher(dataset1_type& data1, dataset2_type& data2) :
    m_data1(data1), m_data2(data2) {}

  double dist(int i, int j, double norm) const {
    return common::norm(m_data1.get(i)-m_data2.get(j), norm);
  }

  virtual void doMatch() = 0;
};

#endif /* MATCHING_H_ */
